<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Shader</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
    <script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">

<div id="doc">
    <div id="hd" class="yui3-g header">
        <div class="yui3-u-3-4">
            
                <h1><img src="../assets/css/logo.png" title=""></h1>
            
        </div>
        <div class="yui3-u-1-4 version">
            <em>API Docs for: </em>
        </div>
    </div>
    <div id="bd" class="yui3-g">

        <div class="yui3-u-1-4">
            <div id="docs-sidebar" class="sidebar apidocs">
                <div id="api-list">
    <h2 class="off-left">APIs</h2>
    <div id="api-tabview" class="tabview">
        <ul class="tabs">
            <li><a href="#api-classes">Classes</a></li>
            <li><a href="#api-modules">Modules</a></li>
        </ul>

        <div id="api-tabview-filter">
            <input type="search" id="api-filter" placeholder="Type to filter APIs">
        </div>

        <div id="api-tabview-panel">
            <ul id="api-classes" class="apis classes">
            
                <li><a href="../classes/BBox.html">BBox</a></li>
            
                <li><a href="../classes/Buffer.html">Buffer</a></li>
            
                <li><a href="../classes/geo.html">geo</a></li>
            
                <li><a href="../classes/GL.html">GL</a></li>
            
                <li><a href="../classes/Indexer.html">Indexer</a></li>
            
                <li><a href="../classes/LEvent.html">LEvent</a></li>
            
                <li><a href="../classes/Mesh.html">Mesh</a></li>
            
                <li><a href="../classes/Octree.html">Octree</a></li>
            
                <li><a href="../classes/Shader.html">Shader</a></li>
            
                <li><a href="../classes/Texture.html">Texture</a></li>
            
            </ul>

            <ul id="api-modules" class="apis modules">
            
            </ul>
        </div>
    </div>
</div>

            </div>
        </div>
        <div class="yui3-u-3-4">
                <div id="api-options">
        Show:
        <label for="api-show-inherited">
            <input type="checkbox" id="api-show-inherited" checked>
            Inherited
        </label>

        <label for="api-show-protected">
            <input type="checkbox" id="api-show-protected">
            Protected
        </label>

        <label for="api-show-private">
            <input type="checkbox" id="api-show-private">
            Private
        </label>
        <label for="api-show-deprecated">
            <input type="checkbox" id="api-show-deprecated">
            Deprecated
        </label>

    </div>


            <div class="apidocs">
                <div id="docs-main">
                    <div class="content">
                        <h1>Shader Class</h1>
<div class="box meta">
    

    

    
        <div class="foundat">
            Defined in: <a href="../files/.._src_shader.js.html#l1"><code>..&#x2F;src&#x2F;shader.js:1</code></a>
        </div>
    

    

    
</div>



<div class="box intro">
    <p>Shader class to upload programs to the GPU</p>

</div>


    <div class="constructor">
        <h2>Constructor</h2>
        <div id="method_Shader" class="method item">
    <h3 class="name"><code>Shader</code></h3>

    
        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
            
                <li class="arg">
                    
                        <code>vertexSource</code>
                    
                </li>
            
                <li class="arg">
                    
                        <code>fragmentSource</code>
                    
                </li>
            
                <li class="arg">
                    
                        <code>macros</code>
                    
                </li>
            
            </ul><span class="paren">)</span>
        </div>
    

    

    

    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/.._src_shader.js.html#l1"><code>..&#x2F;src&#x2F;shader.js:1</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        
    </div>

    
        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
            
                <li class="param">
                    
                        <code class="param-name">vertexSource</code>
                        <span class="type">String</span>
                    

                    

                    <div class="param-description">
                         
                    </div>

                    
                </li>
            
                <li class="param">
                    
                        <code class="param-name">fragmentSource</code>
                        <span class="type">String</span>
                    

                    

                    <div class="param-description">
                         
                    </div>

                    
                </li>
            
                <li class="param">
                    
                        <code class="param-name">macros</code>
                        <span class="type">Object</span>
                    

                    

                    <div class="param-description">
                        <p>(optional) precompiler macros to be applied when compiling</p>

                    </div>

                    
                </li>
            
            </ul>
        </div>
    

    

    
</div>

    </div>


<div id="classdocs" class="tabview">
    <ul class="api-class-tabs">
        <li class="api-class-tab index"><a href="#index">Index</a></li>

        
            <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
        
        
        
        
    </ul>

    <div>
        <div id="index" class="api-class-tabpanel index">
            <h2 class="off-left">Item Index</h2>

            
                <div class="index-section methods">
                    <h3>Methods</h3>

                    <ul class="index-list methods">
                        
                            <li class="index-item method">
                                <a href="#method_draw">draw</a>

                                
                                
                            </li>
                        
                            <li class="index-item method">
                                <a href="#method_drawBuffers">drawBuffers</a>

                                
                                
                            </li>
                        
                            <li class="index-item method">
                                <a href="#method_drawRange">drawRange</a>

                                
                                
                            </li>
                        
                            <li class="index-item method">
                                <a href="#method_uniforms">uniforms</a>

                                
                                
                            </li>
                        
                    </ul>
                </div>
            

            

            

            
        </div>

        
            <div id="methods" class="api-class-tabpanel">
                <h2 class="off-left">Methods</h2>

                
                    <div id="method_draw" class="method item">
    <h3 class="name"><code>draw</code></h3>

    
        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
            
                <li class="arg">
                    
                        <code>mesh</code>
                    
                </li>
            
                <li class="arg">
                    
                        <code>mode</code>
                    
                </li>
            
            </ul><span class="paren">)</span>
        </div>
    

    

    

    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/.._src_shader.js.html#l226"><code>..&#x2F;src&#x2F;shader.js:226</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        <p>Renders a mesh using this shader, remember to use the function uniforms before to enable the shader</p>

    </div>

    
        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
            
                <li class="param">
                    
                        <code class="param-name">mesh</code>
                        <span class="type"><a href="../classes/Mesh.html" class="crosslink">Mesh</a></span>
                    

                    

                    <div class="param-description">
                         
                    </div>

                    
                </li>
            
                <li class="param">
                    
                        <code class="param-name">mode</code>
                        <span class="type">Number</span>
                    

                    

                    <div class="param-description">
                        <p>could be gl.LINES, gl.POINTS, gl.TRIANGLES, gl.TRIANGLE_STRIP, gl.TRIANGLE_FAN</p>

                    </div>

                    
                </li>
            
            </ul>
        </div>
    

    

    
</div>

                
                    <div id="method_drawBuffers" class="method item">
    <h3 class="name"><code>drawBuffers</code></h3>

    
        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
            
                <li class="arg">
                    
                        <code>vertexBuffers</code>
                    
                </li>
            
                <li class="arg">
                    
                        <code>indexBuffer</code>
                    
                </li>
            
                <li class="arg">
                    
                        <code>mode</code>
                    
                </li>
            
                <li class="arg">
                    
                        <code>range_start</code>
                    
                </li>
            
                <li class="arg">
                    
                        <code>range_length</code>
                    
                </li>
            
            </ul><span class="paren">)</span>
        </div>
    

    

    

    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/.._src_shader.js.html#l253"><code>..&#x2F;src&#x2F;shader.js:253</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        <p>Renders a range of a mesh using this shader</p>

    </div>

    
        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
            
                <li class="param">
                    
                        <code class="param-name">vertexBuffers</code>
                        <span class="type">Object</span>
                    

                    

                    <div class="param-description">
                        <p>an object containing all the buffers</p>

                    </div>

                    
                </li>
            
                <li class="param">
                    
                        <code class="param-name">indexBuffer</code>
                        <span class="type">IndexBuffer</span>
                    

                    

                    <div class="param-description">
                         
                    </div>

                    
                </li>
            
                <li class="param">
                    
                        <code class="param-name">mode</code>
                        <span class="type">Number</span>
                    

                    

                    <div class="param-description">
                        <p>could be gl.LINES, gl.POINTS, gl.TRIANGLES, gl.TRIANGLE_STRIP, gl.TRIANGLE_FAN</p>

                    </div>

                    
                </li>
            
                <li class="param">
                    
                        <code class="param-name">range_start</code>
                        <span class="type">Number</span>
                    

                    

                    <div class="param-description">
                        <p>first primitive to render</p>

                    </div>

                    
                </li>
            
                <li class="param">
                    
                        <code class="param-name">range_length</code>
                        <span class="type">Number</span>
                    

                    

                    <div class="param-description">
                        <p>number of primitives to render</p>

                    </div>

                    
                </li>
            
            </ul>
        </div>
    

    

    
</div>

                
                    <div id="method_drawRange" class="method item">
    <h3 class="name"><code>drawRange</code></h3>

    
        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
            
                <li class="arg">
                    
                        <code>mesh</code>
                    
                </li>
            
                <li class="arg">
                    
                        <code>mode</code>
                    
                </li>
            
                <li class="arg">
                    
                        <code>start</code>
                    
                </li>
            
                <li class="arg">
                    
                        <code>length</code>
                    
                </li>
            
            </ul><span class="paren">)</span>
        </div>
    

    

    

    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/.._src_shader.js.html#l238"><code>..&#x2F;src&#x2F;shader.js:238</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        <p>Renders a range of a mesh using this shader</p>

    </div>

    
        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
            
                <li class="param">
                    
                        <code class="param-name">mesh</code>
                        <span class="type"><a href="../classes/Mesh.html" class="crosslink">Mesh</a></span>
                    

                    

                    <div class="param-description">
                         
                    </div>

                    
                </li>
            
                <li class="param">
                    
                        <code class="param-name">mode</code>
                        <span class="type">Number</span>
                    

                    

                    <div class="param-description">
                        <p>could be gl.LINES, gl.POINTS, gl.TRIANGLES, gl.TRIANGLE_STRIP, gl.TRIANGLE_FAN</p>

                    </div>

                    
                </li>
            
                <li class="param">
                    
                        <code class="param-name">start</code>
                        <span class="type">Number</span>
                    

                    

                    <div class="param-description">
                        <p>first primitive to render</p>

                    </div>

                    
                </li>
            
                <li class="param">
                    
                        <code class="param-name">length</code>
                        <span class="type">Number</span>
                    

                    

                    <div class="param-description">
                        <p>number of primitives to render</p>

                    </div>

                    
                </li>
            
            </ul>
        </div>
    

    

    
</div>

                
                    <div id="method_uniforms" class="method item">
    <h3 class="name"><code>uniforms</code></h3>

    
        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
            
                <li class="arg">
                    
                        <code>uniforms</code>
                    
                </li>
            
            </ul><span class="paren">)</span>
        </div>
    

    

    

    

    

    

    

    

    <div class="meta">
        
            
                
                <p>
                
                Defined in
                
            
        
        
        <a href="../files/.._src_shader.js.html#l133"><code>..&#x2F;src&#x2F;shader.js:133</code></a>
        
        </p>


        

        
    </div>

    <div class="description">
        <p>Uploads a set of uniforms to the Shader</p>

    </div>

    
        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
            
                <li class="param">
                    
                        <code class="param-name">uniforms</code>
                        <span class="type">Object</span>
                    

                    

                    <div class="param-description">
                         
                    </div>

                    
                </li>
            
            </ul>
        </div>
    

    

    
</div>

                
            </div>
        

        

        

        
    </div>
</div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
